import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
//导入http服务功能
import { HttpClientModule } from '@angular/common/http'

//导入http拦截器
import { GlobalNoopInterceptor } from "./global.interceptor"
import { HTTP_INTERCEPTORS } from "@angular/common/http"

import { AppComponent } from './app.component';
import { NavbarComponent } from './navbar/navbar.component';
import { SidebarComponent } from './sidebar/sidebar.component';
import { SiginComponent } from './sigin/sigin.component';
import { SiginupComponent } from './siginup/siginup.component';
import { ComtactListComponent } from './comtact-list/comtact-list.component';
import { ComtactNewComponent } from './comtact-new/comtact-new.component';
import { ComtactEditComponent } from './comtact-edit/comtact-edit.component';
import { TagListComponent } from './tag-list/tag-list.component';
import { TagNewComponent } from './tag-new/tag-new.component';
import { TagEditComponent } from './tag-edit/tag-edit.component';
import { AppRoutingModule } from './/app-routing.module';
import { LayoutComponent } from './layout/layout.component';

// 导入表单双向绑定模块
import { FormsModule } from '@angular/forms';

@NgModule({
  declarations: [
    AppComponent,
    NavbarComponent,
    SidebarComponent,
    SiginComponent,
    SiginupComponent,
    ComtactListComponent,
    ComtactNewComponent,
    ComtactEditComponent,
    TagListComponent,
    TagNewComponent,
    TagEditComponent,
    LayoutComponent
  ],
  imports: [
    BrowserModule,
    AppRoutingModule,
    FormsModule,
    HttpClientModule
  ],
  providers: [{
    provide: HTTP_INTERCEPTORS, 
    useClass: GlobalNoopInterceptor, 
    multi: true 
  }],
  bootstrap: [AppComponent]
})
export class AppModule { }
